import 'package:flutter/material.dart';

/// @author jltxseo
///         Created by junlintianxia on 2020/04/22.

class ContextRoute extends StatelessWidget {
  const ContextRoute({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      child: Builder(builder: (context) {
        Scaffold? scaffold = context.findAncestorWidgetOfExactType<Scaffold>();
        AppBar? appBar = scaffold?.appBar as AppBar?;
        return appBar?.title ?? Text('No Title');
      }),
    );
  }
}
